package com.neborosoft.lib.time;

public class ExecuteTime {
    public volatile static boolean inNano=false;
    private long startTime;
    ExecuteTime(){
        if(inNano)
            startTime = System.nanoTime();
        else
            startTime = System.currentTimeMillis();
    }
    long getTimeDiff(){
        if(inNano)
            return  System.nanoTime() - startTime;
        return System.currentTimeMillis()-startTime;
    }
    void reset(){
        if(inNano)
            startTime = System.nanoTime();
        else
            startTime = System.currentTimeMillis();
    }
}
